#import "NSHTTPCookie+Utils.h"


@implementation NSHTTPCookie (Utils)
- (NSString *)javascriptString {
    NSString *string = [NSString stringWithFormat:@"%@=%@;domain=%@;path=%@",
                                                  self.name,
                                                  self.value,
                                                  self.domain,
                                                  self.path ?: @"/"];
    if (self.secure) {
        string = [string stringByAppendingString:@";secure=true"];
    }
    return string;
}
@end
